/*
 * GBC.java
 *
 * Created on January 6, 2007, 9:40 AM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package net.sf.iSnake.UI;

import java.awt.GridBagConstraints;
import java.awt.Insets;

/**
 *
 * @author thelinuxmaniac
 * This class simplifies the use of GridBagConstraints Layout Manager
 */
public class GBC extends GridBagConstraints {
    
    /** Creates a new instance of GBC */
    public GBC() {
    }
    
    public GBC(int gridx, int gridy)
    {
        this.gridx = gridx;
        this.gridy = gridy;
    }
    
    public GBC(int gridx, int gridy, int gridwidth, int gridheight)
    {
        this.gridx = gridx;
        this.gridy = gridy;
        this.gridwidth = gridwidth;
        this.gridheight = gridheight;
    }
    
    public GBC setAnchor(int anchor)
    {
        this.anchor = anchor;
        return this;
    }
    
    public GBC setFill(int fill)
    {
        this.fill = fill;
        return this;
    }
    
    public GBC setWeight(double weightx, double weigthy)
    {
        this.weightx = weightx;
        this.weighty = weigthy;
        return this;
    }
    
    public GBC setInsets(int distance)
    {
        this.insets = new Insets(distance,distance,distance,distance);
        return this;
    }
    
    public GBC setInsets(int top,int left,int bottom,int right)
    {
        this.insets = new Insets(top,left,bottom,right);
        return this;
    }
    
    public GBC setIpad(int ipadx,int ipady)
    {
        this.ipadx = ipadx;
        this.ipady = ipady;
        return this;
    }
}
